package com.yinhe.music.yhmusic.localmusic.adapter;

import android.support.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.yinhe.music.yhmusic.R;
import com.yinhe.music.yhmusic.model.Music;

import java.util.List;

/**
 * @author hasee
 * @date 2017/8/15
 */

public class LocalMusicAdapter extends BaseQuickAdapter<Music, BaseViewHolder> {

    public LocalMusicAdapter(List<Music> data) {
        super(R.layout.new_music_recyclerview_item, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, Music item) {
        helper.setText(R.id.playlist_song, item.getSongName())
                .setText(R.id.playlist_singer, item.getSingerName())
                .addOnClickListener(R.id.playlist_more);
        if (item.isLocalMusic()){
            helper.setVisible(R.id.image_get,true);
        } else {
            helper.setGone(R.id.image_get,false);
        }
        helper.addOnClickListener(R.id.playlist_more);
    }
}
